<template>
  <div class='wrapper' v-for='item of menus' :key='item.id'>
    <div class='title'>
      <img class='title-img' :src="iconUrl+item.pic" alt=''>
      <span class='title-text'>{{item.title}}</span>
    </div>

    <ul class='iconList'>
      <a v-for='icon of item.list' :key='icon.id' tag='li' :href='icon.linkUrl' class='item'  >
        <img class='icon-img' :src='iconUrl+icon.pic' alt=''>
        <div class='icon-title'>{{icon.title}}</div>
      </a>
    </ul>
  </div>
</template>

<script>

export default {
  name: 'HomeCard',
  props: {
    menus: Array
  },
  data () {
    return {
      iconUrl: 'https://qccxweb.nbwhlt.com/icon/'
    }
  }
}
</script>

<style  lang='scss' scoped>
.wrapper{
  margin-top: 0.32rem;
  padding: 0 0.32rem;
  background-color: #fff;
  .title{
    height: 0.64rem;
    line-height: 0.64rem;
    font-size: 0.36rem;
    margin-bottom: 0.16rem;
    .title-img{
      width: 0.64rem;
      height: 0.64rem;
      margin-right: 0.16rem;
    }
  }
  .iconList{
    display: flex;
    flex-wrap:wrap;
    justify-content:flex-start;
    .item{
      width: 25%;
      margin-bottom: 0.32rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      &:nth-child(4n){
       margin-right: 0;
      }
      .icon-img{
        width: 0.88rem;
        height: 0.88rem;
        margin-bottom: 0.12rem;
      }
      .icon-title{
        text-align: center;
        font-size: 0.32rem;
        height: 0.72rem;
        line-height: 0.36rem;
        text-align: center;
      }
    }
  }
}

</style>
